(function() {
	L.BgMarker = L.Marker.extend({
		_initIcon: function () {
		      var t = this.options,
		      e = this._map,
		      i = e.options.zoomAnimation && e.options.markerZoomAnimation,
		      n = i ? 'leaflet-zoom-animated' : 'leaflet-zoom-hide',
		      s = t.icon.createIcon(this._icon),
		      a = !1;
		      s !== this._icon && (this._icon && this._removeIcon(), a = !0, t.title && (s.title = t.title), t.alt && (s.alt = t.alt)),
		      L.DomUtil.addClass(s, n),
		      t.keyboard && (s.tabIndex = '0'),
		      this._icon = s,
		      this._initInteraction(),
		      t.riseOnHover && L.DomEvent.on(s, 'mouseover', this._bringToFront, this).on(s, 'mouseout', this._resetZIndex, this);
		      var r = t.icon.createShadow(this._shadow),
		      h = !1;
		      r !== this._shadow && (this._removeShadow(), h = !0),
		      r && L.DomUtil.addClass(r, n),
		      this._shadow = r,
		      t.opacity < 1 && this._updateOpacity();
		      var l = this._map._panes;
		      a && l.overlayPane.appendChild(this._icon),
		      r && h && l.shadowPane.appendChild(this._shadow)
		},
	    _setPos: function (t) {
	        L.DomUtil.setPosition(this._icon, t),
	        this._shadow && L.DomUtil.setPosition(this._shadow, t),
	        this._zIndex = t.y + this.options.zIndexOffset,
	        this._resetZIndex()
		},
		_updateZIndex: function (t) {
		    //this._icon.style.zIndex = this._zIndex + t
			this._icon.style.zIndex = -1;
		},
	    _removeIcon: function () {
	        this.options.riseOnHover && L.DomEvent.off(this._icon, 'mouseover', this._bringToFront).off(this._icon, 'mouseout', this._resetZIndex),
	        this._map._panes.overlayPane.removeChild(this._icon),
	        this._icon = null
	    }
	}),L.bgmarker = function(t, e) {
	    return new L.BgMarker(t, e);
	}
})();